package com.dw

/**
 * @Date: 23.6.14 
 * @Author: Hang.Nian.YY
 * @qq: 598196583
 * @Tips: 学大数据 ,到多易教育
 * @Description:
 */
object UAttr {
  def main(args: Array[String]): Unit = {
    /**
     * "e2"  , "e3" , "e5" , "e2" , "e4" , "e6"
     *  1        2      3      4      5       6
     *  6        5      4      3      2        1
     *  5        3       1     1      3         5
     */
    val ls = List[String]("e2"  , "e3" , "e5" , "e2" , "e4" , "e6")

    val number1 = 1 to ls.size
    val number2 = number1.reverse
    // 拉链操作
    val zipRes: Seq[(Int, Int)] = number1.zip(number2)
    val ints = zipRes.map(tp => {
      Math.abs(tp._1 - tp._2)
    })

    val fm = ints.sum.toDouble

    ints.map(_/fm).foreach(println)



  }

}
